import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path, { resolve } from "path";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base:'/web/weibo/',//打包路径
  resolve:{
    alias:{
      '@':path.resolve(__dirname,'./src')//设置路径的别名，src直接使用@代替
    }
  },
  server:{//代理
    port:5000,
    open:'localhost',
    proxy:{
      '/weibo':{
        target:'http://10.86.120.128:8080',
        cookiePathRewrite:{
          '/weibo':''
        }
      }
    },
    cors:true //是否跨域
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `$theme:red;`
      }
    }
  }
})
